An optical system has been developed to measure the small motions of a person's head during a positron emission tomography (PET) scan in order to correct the scan and thereby improve the resolution of the image. The system uses a position-sensitive detector to sense changes sequentially in the positions of four blinking LEDs that are fixed to the patient's head. The computer-controlled instrument computes the six degrees of freedom (three angles and three positions) that are necessary to characterize head movement.